﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;

namespace MyWcfRestLib
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService2" in both code and config file together.
    [ServiceContract]
    public interface ICalculator
    {
        [OperationContract]
        [WebInvoke(UriTemplate = "add?x={x}&y={y}")]
        long Add(long x, long y);

        [OperationContract]
        [WebInvoke(UriTemplate = "sub?x={x}&y={y}")]
        long Subtract(long x, long y);

        [OperationContract]
        [WebInvoke(UriTemplate = "mult?x={x}&y={y}")]
        long Multiply(long x, long y);

        [OperationContract]
        [WebInvoke(UriTemplate = "div?x={x}&y={y}")]
        long Divide(long x, long y);

        [OperationContract]
        [WebGet(UriTemplate = "hello?name={name}")]
        string SayHello(string name);
    }
}
